bool* kidsWithCandies(int* candies, int candiesSize, int extraCandies, int* returnSize) {
    bool* res = (bool*)malloc(candiesSize * sizeof(bool));
    if (res == NULL) {
        return NULL;
    }

    int maxNum = 0;
    *returnSize = 0;
    for (int i = 0; i < candiesSize; ++i) {
        maxNum = maxNum >= candies[i] ? maxNum : candies[i];
    }

    for (int i = 0; i < candiesSize; ++i) {
        res[(*returnSize)++] = candies[i] + extraCandies >= maxNum ? true : false;
    }

    return res;
}
